import request from '@/config/axios'

// 会员成长值变动记录 VO
export interface MemberGrowthRecordVO {
  id: number // 记录ID
  userType: number // 用户类型
  userId: number // 用户ID
  orderId: number // 关联订单ID
  growthValue: number // 成长值
  reason: string // 变动原因
}

// 会员成长值变动记录 API
export const MemberGrowthRecordApi = {
  // 查询会员成长值变动记录分页
  getMemberGrowthRecordPage: async (params: any) => {
    return await request.get({ url: `/ride/member-growth-record/page`, params })
  },

  // 查询会员成长值变动记录详情
  getMemberGrowthRecord: async (id: number) => {
    return await request.get({ url: `/ride/member-growth-record/get?id=` + id })
  },

  // 新增会员成长值变动记录
  createMemberGrowthRecord: async (data: MemberGrowthRecordVO) => {
    return await request.post({ url: `/ride/member-growth-record/create`, data })
  },

  // 修改会员成长值变动记录
  updateMemberGrowthRecord: async (data: MemberGrowthRecordVO) => {
    return await request.put({ url: `/ride/member-growth-record/update`, data })
  },

  // 删除会员成长值变动记录
  deleteMemberGrowthRecord: async (id: number) => {
    return await request.delete({ url: `/ride/member-growth-record/delete?id=` + id })
  },

  // 导出会员成长值变动记录 Excel
  exportMemberGrowthRecord: async (params) => {
    return await request.download({ url: `/ride/member-growth-record/export-excel`, params })
  },
}